package com.xix.canal.client.writer.logger;

import com.xixi.canal.client.DataWriter;
import com.xixi.canal.client.support.Dml;
import com.xixi.canal.client.support.WriterConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.List;
import java.util.Properties;

public class LoggerWriter implements DataWriter {

    private Logger logger = LoggerFactory.getLogger(LoggerWriter.class);
    @Override
    public void init(String destination, WriterConfig writerConfig, Properties envProperties) {

    }

    @Override
    public void destroy() {

    }

    @Override
    public void write(List<Dml> dmlList) {

        for (Dml dml : dmlList) {
            logger.info("DML:{}", dml);
        }
    }
}
